<template>
    <!-- 订单及物流信息 -->
    <a-modal title="订单及物流信息" width="900px" :visible="visible" :maskClosable="false" :okButtonProps="{ style: { display: 'none' } }" @cancel="handleCancel" cancelText="关闭" style="top: 20px">
        <a-spin :spinning="loading">
            <a-descriptions bordered title="订单信息:" size="small"  layout="vertical" :column="4" >
                <a-descriptions-item label="订单编号:">
                    {{ model.orderSn }}
                </a-descriptions-item>
                <a-descriptions-item label="订单类型:">
                    {{ model.orderType_dictText }}
                </a-descriptions-item>
                <a-descriptions-item label="经销商:">
                    {{ model.storeId_dictText }}
                </a-descriptions-item>
                <a-descriptions-item label="提交时间:">
                    {{ model.createTime }}
                </a-descriptions-item>
                <a-descriptions-item label="订单状态:">
                    {{ model.status_dictText }}
                </a-descriptions-item>
                <a-descriptions-item label="最后出库时间:">
                    {{ model.outboundTime }}
                </a-descriptions-item>
                <a-descriptions-item label="订单总件数:">
                    {{ model.payAmount }}
                </a-descriptions-item>
                <a-descriptions-item label="出库总件数:">
                    {{ model.payAmount }}
                </a-descriptions-item>
            </a-descriptions>
            <a-descriptions bordered title="物流信息:" size="small" style="margin-top: 20px;" :column="4" layout="vertical">
                <a-descriptions-item label="物流公司:" >
                    物流公司物流公司物流公司物流公司物流公司
                </a-descriptions-item>
                <a-descriptions-item label="公司主页:">
                    <p>-</p>
                </a-descriptions-item>
                <a-descriptions-item label="电话:">
                    <p>-</p>
                </a-descriptions-item>
                <a-descriptions-item label="传真:" >
                    <p>-</p>
                </a-descriptions-item>
                <a-descriptions-item label="明细:" :span="4">
                    <a-table :columns="columns" bordered :data-source="data" size="small" />
                </a-descriptions-item>

            </a-descriptions>
        </a-spin>
    </a-modal>
</template>
<script>
import { httpAction, getAction } from "@/api/manage";

export default {
    name: "OmsOrderLogisticsModal",

    data() {
        return {
            visible: false,
            model: {},
            url: {
                storeInfo: "stm/stmStoreInfo/storeInfo",
            },
            loading: false,
            columns: [
                {
                    title: '物流单号',
                    dataIndex: 'name',
                },
                {
                    title: '提货日期',
                    dataIndex: 'age',
                },
                {
                    title: '出库单号',
                    dataIndex: 'address',
                },
                {
                    title: '总数量',
                    dataIndex: 'address',
                },
                {
                    title: '总件数',
                    dataIndex: 'address',
                },
                {
                    title: '总立方数',
                    dataIndex: 'address',
                },
            ],
            data: []
        };
    },

    methods: {
        show(record) {
            this.visible = true;
            console.log(record)
            this.model = Object.assign({}, record);
            this.data = [
                {
                    key: '1',
                    name: '2345678',
                    age: 32,
                    address: '1234567',
                },
                {
                    key: '2',
                    name: '234567823',
                    age: 42,
                    address: '1234567',
                },
                {
                    key: '3',
                    name: '23456781111',
                    age: 32,
                    address: '1234567',
                },
            ]
            // if (this.model.id) {
            //     this.loadGoodsData();
            // }
        },
        // 获取明细
        loadGoodsData() {
            var params = { id: this.model.id };
            this.loading = true;
            getAction(this.url.omsOrderItem.list, params).then((res) => {
                if (res.success) {

                }
                if (res.code === 510) {
                    this.$message.warning(res.message);
                }
                this.loading = false;
            });
        },

        close() {
            this.$emit("close");
            this.visible = false;
        },

        handleCancel() {
            this.close();
        },

    },
    components: {

    }
};
</script>
<style scoped lang="less">
/deep/ .ant-table {
    font-size: 12px;
}

.minTable {

    /deep/ .ant-table {
        th,
        td {
            padding-left: 2px !important;
            padding-right: 2px !important;
        }
    }

    /deep/ .ant-table-column-title {
        white-space: pre;
    }

    .red {
        color: red;
        font-weight: 600;
    }
}

/deep/ .ant-table-footer {
    padding: 0 !important;

}

.footerTable {

    /deep/ .ant-table-thead {
        display: none;
    }

    /deep/ .ant-table-body {
        overflow-x: hidden !important;
    }

}
</style>
